$('document').ready(function() {
    $('#delete-multiple-items').click(function() {
        $('#delete-multiple-items-form').submit();
    });
    $('input.upload-photo').click(function(e) {
        e.preventDefault();
        alert("We are so sorry this module is under construction.");
    });
    
    var searchBox = 'div[id="small-menu:search-bar"]';
    var searchInput = 'input[id="small-menu:search-box-input"]';

    $('#search-item').click(function() {
        $(searchBox).fadeIn(400, function() {
            $(searchInput).focus().select();
        });
    });
    
    $(searchInput).focus(function(){
        $(this).select();
    }).focusout(function() {
        $(searchBox).fadeOut();
    }).keypress(function(e) {
        if (e.which === 13) {
            e.preventDefault();
        }
    });
    
    $('a.item-view').click(function(e) {
        e.preventDefault();
        window.open($(this).attr('href'), '', 'width=600, height=600');
    });
    
});
